<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>闭包案例</title>
</head>
<body>
    <script>
        // console.log(Math.pow(2,3))
        // console.log(Math.pow(3,2))

        function powFun (power){
            return function (number){
                return Math.pow(number,power)
            }
        }
        const pow1 = powFun(2)
        const pow2 = powFun(3)
        console.log(pow1(6))
        console.log(pow2(2))
    </script>
</body>
</html>